import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

// 导入element.js
import './plugins/element.js'
// 导入全局样式文件
import './assets/css/global.css'
import TreeTable from 'vue-table-with-tree-grid'

// 引入面包屑公共使用
import MBX from './components/MBX.vue'
import axios from 'axios'
// 挂载全局组件
Vue.component('TreeTable', TreeTable)
Vue.component('MBX', MBX)
// 导入axios
axios.defaults.baseURL = 'http://127.0.0.1:8888/api/private/v1/'
// 请求拦截器
axios.interceptors.request.use(config => {
  config.headers.Authorization = sessionStorage.getItem('token')
  return config
})
// Vue是个构造韩他有个原型对象,所以axios挂在原型对象上
Vue.prototype.$http = axios
Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
